package com.zyp.boot07.mapper;

import com.zyp.boot07.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("SELECT password FROM user WHERE username=#{username}")
    User selectByUsername(String username);

    @Insert("INSERT INTO user (id,username,password,nickname) VALUES (NULL,#{username},#{password},#{nickname})")
    int insert(User user);
}
